//***************************************************************************
//*
//*	File:			dswl_textwindow.h
//*	Description:	Wrapper for ITextWindow interface
//*
//***************************************************************************
//*
//*	Note:			This source code is provided "as is" meaning that you may 
//*					use it at your own risk. 
//*					You are free to use it in any way you like.
//*
//***************************************************************************
//*
//*	History:		
//*
//*	-------------------------------------------------------------------------
//*	2003/07/27	|	Initial release									|	rk
//*	-------------------------------------------------------------------------
//*
//***************************************************************************

//
//-------------------------------------------------------------- PREPROCESSOR 
//

#ifndef			_DSWL_TEXTWINDOW_H_INCLUDED
#define			_DSWL_TEXTWINDOW_H_INCLUDED

#if				_MSC_VER > 1000
#pragma once
#ifdef			__SWITCH_SHOW_HEADER
#pragma message ("-- dswl_textwindow.h\n")
#endif
#ifdef			__SWITCH_SHOW_HEADER_TREE
#pragma message ("-- "__FILE__"\n")
#endif
#endif 

#ifdef			_DSWL_SWITCH_USE_AUTOCAST
#ifdef			_DSWL_SWITCH_USE_UNSAFE_AUTOCAST
#pragma	message ( "-- dswl_textwindow.h \t Warning: Generating auto-cast operator: CITextWindow::operator ITextWindow* () const" )
#else
#pragma	message ( "-- dswl_textwindow.h \t Warning: Generating auto-cast operator: CITextWindow::operator       ITextWindow* ()" )
#pragma	message ( "-- dswl_textwindow.h \t Warning: Generating auto-cast operator: CITextWindow::operator const ITextWindow* () const" )
#endif
#endif

//
//-------------------------------------------------------------- DEPENDENCIES
//

//
//------------------------------------------------------ FORWARD DECLARATIONS
//

class			CIApplication	;
class			CITextDocument	;
class			CITextSelection	;
class			CIGenericWindow	;

//
//--------------------------------------------------------- CLASS DECLARATION
//

//***************************************************************************
//**	@DOC		CLASS CITextWindow
//***************************************************************************
//*		@CLASS		Wrapper for ITextWindow interface
//***************************************************************************
class _DSWL_EXT_CLASS CITextWindow  
{
	//																								
	//-----------------------------------------------------------------------						
	//***************************     ATTRIBS     ***************************						
	//-----------------------------------------------------------------------						
	//																								
private:																									// @ACCESS	Private Attributes	
			CComPtr< ITextWindow >	m_pITextWindow	;														// @CMEMBER	Smart pointer to the actual text window interface
																										
	//																													
	//-----------------------------------------------------------------------											
	//*************************     PROPERTIES     **************************					
	//-----------------------------------------------------------------------											
	//																													
public:																										// @ACCESS	Public Property Methods
			CIApplication			GetApplication		( void )								const	;	// @CMEMBER	Determines the application this window belongs to
			CITextDocument			GetTextDocument		( void )								const	;	// @CMEMBER	Determines the text document this text window belongs to
			CITextSelection			GetTextSelection	( void )								const	;	// @CMEMBER	Determines the text window's current selection
									
	//																											
	//-----------------------------------------------------------------------									
	//*************************     INFORMATION     *************************
	//-----------------------------------------------------------------------									
	//																											
public:																										// @ACCESS	Public Information Methods
			BOOL					IsNull				( void )								const	;	// @CMEMBER	Determines whether the internal pointer is <t NULL>
			BOOL					IsValid				( void )								const	;	// @CMEMBER	Determines whether the internal pointer differs from <t NULL>
									
			CIGenericWindow			GetGenericWindow	( void )								const	;	// @CMEMBER Determines the text window's generic window interface
									
	//																									
	//-----------------------------------------------------------------------							
	//**************************     OPERATORS     **************************							
	//-----------------------------------------------------------------------							
	//																									
public:																										// @ACCESS	Public Operators
			bool					operator	==		( const CITextWindow&	a_Other		)	const	;	// @CMEMBER	Comparison operator
			bool					operator	!=		( const CITextWindow&	a_Other		)	const	;	// @CMEMBER	Comparison operator
			bool					operator	<=		( const CITextWindow&	a_Other		)	const	;	// @CMEMBER	Comparison operator
			bool					operator	>=		( const CITextWindow&	a_Other		)	const	;	// @CMEMBER	Comparison operator
			bool					operator	<		( const CITextWindow&	a_Other		)	const	;	// @CMEMBER	Comparison operator
			bool					operator	>		( const CITextWindow&	a_Other		)	const	;	// @CMEMBER	Comparison operator
																							
			CITextWindow&			operator	=		(		ITextWindow*	a_pIOther	)			;	// @CMEMBER	Copy operator
			CITextWindow&			operator	=		(		IGenericWindow*	a_pIOther	)			;	// @CMEMBER	Assignment operator
			CITextWindow&			operator	=		(		CIGenericWindow	a_pIOther	)			;	// @CMEMBER	Assignment operator
																							
			ITextWindow*			operator	*		( void )										;	// @CMEMBER	Dereference operator
	const	ITextWindow*			operator	*		( void )								const	;	// @CMEMBER	Dereference operator
																							
			ITextWindow*			operator	->		( void )										;	// @CMEMBER	Member access operator
	const	ITextWindow*			operator	->		( void )								const	;	// @CMEMBER	Member access operator
								
	#ifdef	_DSWL_SWITCH_USE_AUTOCAST
	#ifdef	_DSWL_SWITCH_USE_UNSAFE_AUTOCAST
									operator			ITextWindow*	( void )				const	;	// @CMEMBER	TypeCast operator
	#else							
									operator			ITextWindow*	( void )						;	// @CMEMBER	TypeCast operator
									operator	const	ITextWindow*	( void )				const	;	// @CMEMBER	TypeCast operator
	#endif
	#endif

	//																						
	//-----------------------------------------------------------------------				
	//***********************     CON/DESTRUCTION     ***********************				
	//-----------------------------------------------------------------------				
	//																						
public:																										// @ACCESS	Public Con-/Destruction Methods	
	explicit CITextWindow( int				a_iFoo					);										// @CMEMBER	Invalidation constructor
			 CITextWindow( CIGenericWindow	a_pITextWindow			);										// @CMEMBER	Converison constructor
			 CITextWindow( IGenericWindow*	a_pITextWindow			);										// @CMEMBER	Converison constructor
			 CITextWindow( ITextWindow*		a_pITextWindow = NULL	);										// @CMEMBER	Default constructor
	virtual ~CITextWindow();																				// @CMEMBER	Default destructor
};
//***************************************************************************
//**	@END
//***************************************************************************

#endif		// _DSWL_TEXTWINDOW_H_INCLUDED
